# Maintainer: Biswapriyo Nath <nathbappai@gmail.com>

_realname=qoi
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=r288.f6dffaf
pkgrel=1
_commit='f6dffaf1e8170cdd79945a4fb60f6403e447e020'
pkgdesc="The 'Quite OK Image' format for fast, lossless image compression (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
url='https://qoiformat.org/'
license=('spdx:MIT')
makedepends=("git")
source=("git+https://github.com/phoboslab/qoi.git#commit=${_commit}")
sha256sums=('SKIP')

pkgver() {
  cd "${_realname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

package() {
  cd "${_realname}"
  install -Dm644 qoi.h "${pkgdir}${MINGW_PREFIX}"/include/qoi.h
  install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}
